<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>分享赚钱 - {php echo $this->module['config']['sname']}</title>
    {php echo register_jssdk();}
    <meta content="app-id=518966501" name="apple-itunes-app">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <link href="{WELIAM_INDIANA_STATIC}css/common.css" rel="stylesheet">
    <link href="{WELIAM_INDIANA_STATIC}/css/comm.css" rel="stylesheet" type="text/css">
    <link href="{WELIAM_INDIANA_STATIC}/css/member.css" rel="stylesheet" type="text/css">
    <script language="javascript" src="{WELIAM_INDIANA_STATIC}/js/jquery.js"></script>
</head>
<style>
	#moreBtn{position: fixed; top: 0; right: 5px; z-index: 2; padding: 0 10px; line-height: 36px;}
</style>
<body style="zoom: 1; padding-top: 39px;">
<div id="loadingPicBlock">
	<div class="m-simpleHeader" id="dvHeader">
		<a href="javascript:history.back(-1);" data-pro="back" data-back="true" class="m-simpleHeader-back"><i class="ico ico-back"></i></a>
			<h1>个人中心</h1>
		<a id="moreBtn" href="{php echo $this->createMobileUrl('index')}"><i class="ico ico-home"></i></a>
	</div>
    <div class="wrapper m_share">
        <div class="shareCon">
            <div class="m_banner" style="background: url('{php echo tomedia($this->module['config']['invitepicarr'])}');background-size: 100%;"></div>
            <dl>
                <dt>邀请好友成功参与夺宝后，按购买数量返利积分！</dt>
                <dd onclick="$('#m_popUp').show()"><a id="btnShare" href="javascript:;" class="orangeBtn" style="background: #db3652;">立即赚积分</a></dd>
                {if !empty($buy_total)}
                <dd>自己购买返：<em class="orange">{$buy_total}</em>积分</dd>
                {/if}
                <dd>邀请好友：<em class="orange">{$total}</em>人<b></b>积分：<em class="orange">{$credit1['credit1']}</em>分</dd>
            </dl>
             <dl>
             	<table class="table table-hover table-bordered" style="min-width: 300px;" >
						{loop $invite  $item}
						{if $item['type'] != 2}
						<tr style="text-align: center;">
							<td>您于{php echo date('Y-m-d',$item['createtime'])}邀请了</td>
							<td><image src="{php echo tomedia($item['avatar']);}" style="max-width: 48px; max-height: 48px; border: 1px dotted gray"></td>
							<td>{$item['nickname']}</td>
							<td>{if $item['type']==0}购买{elseif $item['type']==1}关注{/if}返利了:<em class="orange"> {$item['credit1']}</em> 积分</td>
						</tr>
						{/if}
						{/loop}
				</table>
             </dl>
        </div>
        <!--弹出-->
        <div class="m_popUp" id="m_popUp" style="display:none;" onclick="$('#m_popUp').hide()">
            <div class="m_guide">
                <span></span>
                <div class="m_how">
                    <h4>怎么赚钱？</h4>
                    <p>1: 点击本页面右上角的三个点的图标</p>
                    <p>2: 选择[发送给朋友]或[分享到朋友圈]</p>
                    <p>3: 经您邀请的好友，成功参与夺宝后，您可获得好友消费额的佣金奖励</p>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
	wx.ready(function (){
	var shareData = {
		title: "{$share_data['share_title']}",
		desc: "{$share_data['share_desc']}",
		link: "{$_W['siteroot']}app/{php echo str_replace('./','',$this->createMobileUrl('invite', array('op'=>'invite', 'invite_openid'=>$_W['openid'])))}",
		imgUrl: "{php echo tomedia($share_data['share_image'])}",
	};
//分享朋友
	wx.onMenuShareAppMessage({
	    title: shareData.title,
	  	desc: shareData.desc,
	  	link: shareData.link,
	  	imgUrl:shareData.imgUrl,
	  	trigger: function (res) {
	  	},
	  	success: function (res) {
	    	window.location.href =adurl;
	  	},
	  	cancel: function (res) {
	  	},
	  	fail: function (res) {
	    	alert(JSON.stringify(res));
	  	}
	});
//朋友圈
	wx.onMenuShareTimeline({
	  	title: shareData.title,
	  	link: shareData.link,
	  	imgUrl:shareData.imgUrl,
	  	trigger: function (res) {
	  	},
	  	success: function (res) {
	    	window.location.href =adurl;
	  	},
	  	cancel: function (res) {
	  	},
	  	fail: function (res) {
	    	alert(JSON.stringify(res));
	  	}
	});
});
</script>

</body></html>